home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / libs / fastsincos2.lha / fastsincos_demo.c < prev    next >
C/C++ Source or Header  |  1992-07-27  |  768b  |  38 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include "proto/exec.h"
  5. #include "proto/dos.h"
  6. #include "fastsincos.h"
  7.  
  8. main()
  9. {
  10.     int    i;
  11.     double    j;
  12.     struct Library *FastsincosBase;
  13.  
  14.     printf("\nFastsincosBase = OpenLibrary(\"fastsincos.library\",0);\t");
  15.     FastsincosBase = OpenLibrary("fastsincos.library",0);
  16.     if (FastsincosBase == NULL)
  17.     {
  18.         printf("Fail\n");
  19.         return(20);
  20.     };
  21.     printf("Ok\n");
  22.  
  23.     printf("\nStarting now 40000 calls to sin in Beatles IEEE library\n");
  24.     j = sqrt(PI);
  25.     for (i=0;i<40000;i++)
  26.         j = sin(j);
  27.  
  28.     printf("\nStarting now 40000 calls to fastsin in fastsincos.library\n");
  29.     j = sqrt(PI);
  30.     for (i=0;i<40000;i++)
  31.         j = fastsin(j);
  32.  
  33.     printf("\nCloseLibrary (FastsincosBase);\n");
  34.     CloseLibrary (FastsincosBase);
  35.     return (EXIT_SUCCESS);
  36. }
  37.  
  38.